Skip to content

refactor: consolidate ScopeMode logic into methods#765

Closed
DaleSeo wants to merge 2 commits into
mainfrom
refactor/auth-cleanups
Closed

refactor: consolidate ScopeMode logic into methods#765
DaleSeo wants to merge 2 commits into
mainfrom
refactor/auth-cleanups

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Jun 12, 2026

Copy link
Copy Markdown
Member

This PR moves the scope-sufficiency match out of the oauth_validate middleware and into a ScopeMode::is_satisfied_by method. This change simplifies the middleware to a single condition. More importantly, it allows the scope-validation tests to call the actual method instead of a hand-copied version that could drift from production. It also updates the scope_mode header rendering. Previously, it serialized the enum to JSON just to trim the quotes and included an unreachable "unknown" fallback. Now, it uses a straightforward and reliable ScopeMode::as_str. A small guard test ensures that as_str stays in sync with the serde snake_case rename.

@DaleSeo DaleSeo self-assigned this Jun 12, 2026
@apollo-librarian

apollo-librarian Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 2b607460d64a5dcb5404f2d0
Build Logs: View logs


✅ AI Style Review — No Changes Detected

No MDX files were changed in this pull request.

Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@DaleSeo DaleSeo force-pushed the refactor/auth-cleanups branch from 8e8244a to 0c642f6 Compare June 12, 2026 18:21
@DaleSeo DaleSeo marked this pull request as ready for review June 12, 2026 18:31
@DaleSeo DaleSeo requested a review from a team as a code owner June 12, 2026 18:31
@github-actions

Copy link
Copy Markdown
Contributor

Changeset file missing for PR

All changes should include an associated changeset file.
Please use knope document-change to create a changeset. (installation instructions: https://knope.tech/installation/)

@DaleSeo

DaleSeo commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

Folded into #764

@DaleSeo DaleSeo closed this Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant